// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取当前登录用户数据 获取当前登录用户数据 GET /api/user/currentUser */
export async function currentUserUsingGET(options?: { [key: string]: any }) {
  return request<API.ResponseUser_>('/api/user/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 删除用户 删除用户 POST /api/user/delete */
export async function deleteUsingPOST2(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUsingPOST2Params,
  options?: { [key: string]: any },
) {
  return request<API.ResponseUser_>('/api/user/delete', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 添加用户 添加用户 POST /api/user/insert */
export async function insertUsingPOST2(body: API.User, options?: { [key: string]: any }) {
  return request<API.ResponseUser_>('/api/user/insert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 检查登录状态 检查登录状态 GET /api/user/isLogin */
export async function isLoginUsingGET(options?: { [key: string]: any }) {
  return request<API.ResponseString_>('/api/user/isLogin', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 用户登录 用户登录 POST /api/user/login */
export async function loginUsingPOST(body: API.UserLoginVo, options?: { [key: string]: any }) {
  return request<API.ResponseSaTokenInfo_>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 退出登录 退出登录 GET /api/user/logout */
export async function logoutUsingGET(options?: { [key: string]: any }) {
  return request<API.ResponseString_>('/api/user/logout', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 用户注册 用户注册 POST /api/user/register */
export async function registerUsingPOST(body: API.User, options?: { [key: string]: any }) {
  return request<API.ResponseUser_>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询用户 查询用户 POST /api/user/select */
export async function selectUsingPOST3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectUsingPOST3Params,
  options?: { [key: string]: any },
) {
  return request<API.PageResultListUser_>('/api/user/select', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 查询用户（主键） 查询用户（主键） GET /api/user/selectById */
export async function selectByIdUsingGET1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.selectByIdUsingGET1Params,
  options?: { [key: string]: any },
) {
  return request<API.ResponseUser_>('/api/user/selectById', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 更新用户 更新用户 POST /api/user/update */
export async function updateUsingPOST2(body: API.User, options?: { [key: string]: any }) {
  return request<API.ResponseUser_>('/api/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 默认Get请求 请求不存在的路径时调用此默认接口 GET /api/user/${param0} */
export async function helloWorldUsingGET2(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.helloWorldUsingGET2Params,
  options?: { [key: string]: any },
) {
  const { name: param0, ...queryParams } = params;
  return request<string>(`/api/user/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}
